admin / Strike
publicWeb-Based UK Cyber Compliance Tool with Reporting
Strike / StrikeXi v3 / backend / app / routers / frameworks.py
780 B · main
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | """Read-only list of available maturity frameworks (v3). Drives the "choose an assessment type" step. Adding a new framework is pure data (seed rows) — it appears here automatically with no code change. """ from fastapi import APIRouter, Depends from sqlalchemy.orm import Session from .. import models, schemas from ..database import get_db from ..security import get_current_user router = APIRouter(prefix="/api/frameworks", tags=["frameworks"]) @router.get("", response_model=list[schemas.FrameworkOut]) def list_frameworks(db: Session = Depends(get_db), user=Depends(get_current_user)): return ( db.query(models.Framework) .filter(models.Framework.is_active == True) # noqa: E712 .order_by(models.Framework.sort_order) .all() ) |